//
//  RetweetedView.swift
//  Weibo项目
//
//  Created by vn on 16/7/24.
//  Copyright © 2016年 vn. All rights reserved.
//

import UIKit

class RetweetedView: UIView {
    
    //给外界提供属性用来赋值
    var ViewModel:StatusViewModel?{
        
        didSet{
            
            
            
            
        self.content_lb.text = ViewModel?.homeModel?.retweeted_status?.text
            
            
            
        }
        
       
        
        
    }
    
    
    
    
    
    
    
  
    override init(frame: CGRect) {
        
        super.init(frame: frame)
        
        
        setUpUI()
        
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    
    
    //添加控件
    func setUpUI(){
        
       
        addSubview(content_lb)
        
        content_lb.snp_makeConstraints { (make) -> Void in
            
            make.top.leading.equalTo(self).offset(10)
            
            
            
        }
        
        
        //根据内容,来动态的约束自己
         self.snp_makeConstraints { (make) -> Void in
            
            make.bottom.equalTo(content_lb.snp_bottom).offset(10)
            
            
         }
        
        
    }
    
    
    
    //懒加载
    
    lazy var content_lb:UILabel = {
        
        
        let lb = UILabel()
        lb.font = UIFont.systemFontOfSize(15)
        lb.textColor = UIColor.blackColor()
        lb.numberOfLines = 0
        lb.preferredMaxLayoutWidth = SCREENW - 20
        
        
         return lb
    }()
    
    
     
    
}
